<?php

	require("header.php");
	require("table_des_matieres.php");

if (isset($valider))
{
	
	echo " 	<fieldset class='alertfieldset'><legend>".$language[$_SESSION['lang']]["SureRefuse"]."</legend>
				".$language[$_SESSION['lang']]["SureRefuse"]."
				<form method='POST'>
					<input type='hidden' name='alert_id' value='".$_POST['alert_id']."' />
					<input type='hidden' name='type' value='".$_POST['type']."' />
					<input type='submit' name='validernon' value='".$language[$_SESSION['lang']]["Yes"]."'  />
					<input type='submit' value='".$language[$_SESSION['lang']]["No"]."' />
				</form>
			</fieldset>";
	
}

foreach ($alerts as $alert)
{
	if ($alert->type == "int")
	{
		echo "	<fieldset class='alertfieldset'>
					<legend>".$language[$_SESSION['lang']]["ReceivedInformations"]."</legend>
					".buttonDoNotDisplay($language,$alert)."
					
					<img src='".$_SESSION['lang'].".lang/alert.png' style='float:left; margin-top:-10px; margin-left:-10px;' />

					<p>
						".$language[$_SESSION['lang']]["TheOwner"]." ".$alert->pers_civilite." ".$alert->pers_nom." ".$alert->pers_prenom." ".$language[$_SESSION['lang']]["Of"]." ".$language[$_SESSION['lang']]["TheLocation"]." ".$alert->location_nom." ".$language[$_SESSION['lang']]["AskYouToBeInt"].".<br />
					</p>
					
					<form style='margin:0;' method='POST'>
						<input type='hidden' name='alert_id' value='".intval($alert->location_id)."' />
						<input type='hidden' name='type' value='int' />
						<input type='submit' name='ouiint' value='".$language[$_SESSION['lang']]["Accept"]."' />
						<input type='submit' name='nonint' value='".$language[$_SESSION['lang']]["Decline"]."' />
					</form>
				</fieldset>";
	}
	else if ($alert->type == "Yint")
	{
		echo "	<fieldset class='alertfieldset'>
					<legend>".$language[$_SESSION['lang']]["ReceivedInformations"]."</legend>
					".buttonDoNotDisplay($language,$alert)."
					
					<img src='".$_SESSION['lang'].".lang/alert.png' style='float:left; margin-top:-10px; margin-left:-10px;' />
					
					".$language[$_SESSION['lang']]["TheLocation"]." ".$alert->location_nom." ".$language[$_SESSION['lang']]["hasNewInt"]." ".$alert->pers_civilite." ".$alert->pers_nom." ".$alert->pers_prenom." (".$alert->pers_login.").
				</fieldset>";
	}
	else if ($alert->type == "Nint")
	{
		echo "	<fieldset class='alertfieldset'>
					<legend>".$language[$_SESSION['lang']]["ReceivedInformations"]."</legend>
					".buttonDoNotDisplay($language,$alert)."
					
					<img src='".$_SESSION['lang'].".lang/alert.png' style='float:left; margin-top:-10px; margin-left:-10px;' />
					
					".$language[$_SESSION['lang']]["DemandForIntLocation"]." ".$language[$_SESSION['lang']]["TheLocation"]." ".$alert->location_nom." ".$language[$_SESSION['lang']]["wasRefused"].".
				</fieldset>";
	}
	else if ($alert->type == "pic")
	{
		echo "	<fieldset class='alertfieldset'>
						<legend>".$language[$_SESSION['lang']]["ReceivedInformations"]."</legend>
						".buttonDoNotDisplay($language,$alert)."	
										
						<img src='".$_SESSION['lang'].".lang/alert.png' style='float:left; margin-top:-10px; margin-left:-10px;' />
						
						".$language[$_SESSION['lang']]["PicAdded"]." ".$alert->location_nom.".
						
				</fieldset>";
	}
	else if ($alert->type == "com")
	{
		echo "	<fieldset class='alertfieldset'>
						<legend>".$language[$_SESSION['lang']]["ReceivedInformations"]."</legend>
						".buttonDoNotDisplay($language,$alert)."	
										
						<img src='".$_SESSION['lang'].".lang/alert.png' style='float:left; margin-top:-10px; margin-left:-10px;' />
						
						".$language[$_SESSION['lang']]["ComAdded"]." ".$alert->location_nom.".
						
				</fieldset>";
	}
	else if ($alert->type == "Yloc")
	{
		echo "	<fieldset class='alertfieldset'>
						<legend>".$language[$_SESSION['lang']]["ReceivedInformations"]."</legend>
						".buttonDoNotDisplay($language,$alert)."	
										
						<img src='".$_SESSION['lang'].".lang/alert.png' style='float:left; margin-top:-10px; margin-left:-10px;' />
						
						".$language[$_SESSION['lang']]["LocationAccepted"]." ".$alert->location_nom.".<br />
						<a href='pdf.php?id=".intval($alert->location_id)."'>".$language[$_SESSION['lang']]["GetContractHere"]."</a>
						
				</fieldset>";
	}
	else if ($alert->type == "Nloc")
	{
		echo "	<fieldset class='alertfieldset'>
						<legend>".$language[$_SESSION['lang']]["ReceivedInformations"]."</legend>
						".buttonDoNotDisplay($language,$alert)."	
										
						<img src='".$_SESSION['lang'].".lang/alert.png' style='float:left; margin-top:-10px; margin-left:-10px;' />
						
						".$language[$_SESSION['lang']]["LocationRefused"]." ".$alert->location_nom.".
						
				</fieldset>";
	}
	else
	{
		$explodedType = explode(":#",$alert->type);
		if ($explodedType[0] == "cnt")
		{
			echo "	<fieldset class='alertfieldset'>
						<legend>".$language[$_SESSION['lang']]["ReceivedInformations"]."</legend>
						".buttonDoNotDisplay($language,$alert)."
						
						<img src='".$_SESSION['lang'].".lang/alert.png' style='float:left; margin-top:-10px; margin-left:-10px;' />
						
						".$explodedType[1]." (".$explodedType[2].") ".$language[$_SESSION['lang']]["wantToLocate"]." ".$alert->location_nom." ".$language[$_SESSION['lang']]["From"]." ".date("d-m-Y H:i",$explodedType[3])." ".$language[$_SESSION['lang']]["To"]." ".date("d-m-Y H:i",$explodedType[4]).".<br />

						<form method='POST'>
							<input type='hidden' name='alert_id' value='".$alert->location_id."' />
							<input type='hidden' name='type' value='".$alert->type."' />
							<input type='submit' name='OuiContrat' value='".$language[$_SESSION['lang']]["Accept"]."' />
							<input type='submit' name='NonContrat' value='".$language[$_SESSION['lang']]["Decline"]."' />
						</form>
					
					</fieldset>";
		}
		else if ($explodedType[0] == "Ycnt")
		{
			echo "	<fieldset class='alertfieldset'>
						<legend>".$language[$_SESSION['lang']]["ReceivedInformations"]."</legend>
						".buttonDoNotDisplay($language,$alert)."
					
					<img src='".$_SESSION['lang'].".lang/alert.png' style='float:left; margin-top:-10px; margin-left:-10px;' />
					
					".$language[$_SESSION['lang']]["YouAcceptedDemand"]." ".$explodedType[1]." (".$explodedType[2].") ".$language[$_SESSION['lang']]["For"]." ".$language[$_SESSION['lang']]["TheLocation"]." ".$language[$_SESSION['lang']]["Of"]." ".$language[$_SESSION['lang']]["TheGood"]." ".$alert->location_nom." ".$language[$_SESSION['lang']]["From"]." ".date("d-m-Y H:i",$explodedType[3])." ".$language[$_SESSION['lang']]["To"]." ".date("d-m-Y H:i",$explodedType[4]).".<br />
					
					</fieldset>";
		}
	}
}

?>

<fieldset>
<legend><?php echo $language[$_SESSION['lang']]["ManageYourProfile"]; ?></legend>
<a href="editProfile.php"><?php echo $language[$_SESSION['lang']]["ManageYourProfile"]; ?></a><br />
</fieldset>

<fieldset>
<legend><?php echo $language[$_SESSION['lang']]["ManageGoods"]; ?></legend>
<a href="ajoutbienproprio.php"><?php echo $language[$_SESSION['lang']]["AddGood"]; ?></a><br />
<a href="gererbienproprio.php"><?php echo $language[$_SESSION['lang']]["EditGood"]; ?></a>
</fieldset>

<fieldset>
<legend><?php echo $language[$_SESSION['lang']]["LocationCalendar"]; ?></legend>
<a href="gererlocationproprio.php"><?php echo $language[$_SESSION['lang']]["SeeModifyCalendar"]; ?></a><br />
<a href="gererlocationproprio.php?people"><?php echo $language[$_SESSION['lang']]["SeePeopleLocation"]; ?></a><br />
<a href="gererlocationproprio.php?prices"><?php echo $language[$_SESSION['lang']]["ManagePrices"]; ?></a>
</fieldset>

<fieldset>
<legend><?php echo $language[$_SESSION['lang']]["middleman"]; ?></legend>
<a href="propriointermed.php"><?php echo $language[$_SESSION['lang']]["SeeMiddlemanList"]; ?></a><br />
<a href="propriointermed.php?ajouter"><?php echo $language[$_SESSION['lang']]["AddInt"]; ?></a><br />
<a href="propriointermed.php?supprimer"><?php echo $language[$_SESSION['lang']]["DeleteInt"]; ?></a>
</fieldset>

<fieldset>
<legend><?php echo $language[$_SESSION['lang']]["Contract"]; ?></legend>
<a href="pdf.php"><?php echo $language[$_SESSION['lang']]["GenerateContract"]; ?></a>
</fieldset>

<fieldset>
<legend><?php echo $language[$_SESSION['lang']]["Statistics"]; ?></legend>
</fieldset>

<?php require("footer.php"); ?>
